home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_candle.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  124 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Candle.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    startup
  14. message    activated
  15. message    touched
  16. message    taken
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd1=inxj173.wav    local
  21. sound    foundSnd2=rv04j02.wav    local
  22.  
  23. thing    player                    local
  24. thing    sender                    local
  25.  
  26. int        bin=0                    local
  27.  
  28. end
  29.  
  30. # ===================================================================
  31.  
  32. code
  33.  
  34. startup:
  35.  
  36.     global10 = 0;
  37.     return;
  38.  
  39. # -------------------------------------------------------------------
  40.  
  41. activated:
  42.  
  43.     StartCutscene(0);
  44.  
  45.     talkCog = GetCogByIndex(0);
  46.     SendMessage(talkCog, 27);
  47.  
  48.     if (Rand() < 0.5)
  49.     {
  50.         SetExtCamOffset('0.15 -0.05 0.04');
  51.     }
  52.     else
  53.     {
  54.         SetExtCamOffset('-0.15 -0.05 0.04');
  55.     }
  56.     SetExtCamLookOffset('0.0 0.02 -0.01');
  57.  
  58.     return;
  59.  
  60. # -------------------------------------------------------------------
  61.  
  62. touched:
  63.  
  64.     sender = GetSenderRef();
  65.     player = GetSourceRef();
  66.  
  67.     # Find out which candle we're picking up...
  68.     if (IsThingModelName(sender, "riv_cndl_awind.3do"))
  69.         bin = 88;
  70.     else if (IsThingModelName(sender, "riv_cndl_bwind.3do"))
  71.         bin = 89;
  72.     else if (IsThingModelName(sender, "riv_cndl_cwind.3do"))
  73.         bin = 90;
  74.     else if (IsThingModelName(sender, "riv_cndl_dwind.3do"))
  75.         bin = 91;
  76.     else
  77.         return;
  78.  
  79.     if (GetInv(player, bin) < GetInvMax(player, bin))
  80.     {
  81.         TakeItem(sender, player);
  82.     }
  83.     else
  84.     {
  85.         EndCutscene();
  86.     }
  87.     
  88.     return;
  89.  
  90. # -------------------------------------------------------------------
  91.  
  92. taken:
  93.  
  94.     player = GetSourceRef();
  95.  
  96.     ChangeInv(player, bin, 1.0);
  97.     SetInvAvailable(player, bin, 1);
  98.     JonesInvItemChanged(bin);
  99.  
  100.     Sleep(1.0);
  101.  
  102.     if (!global10)
  103.     {
  104.         PlayVoice(player, foundSnd1, 1.0, 0);
  105.         global10 = 1;
  106.     }
  107.     else
  108.     {
  109.         PlayVoice(player, foundSnd2, 1.0, 0);
  110.     }
  111.  
  112.     EndCutscene();
  113.  
  114.     return;
  115.  
  116. end
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.